package com.ysd.lis.controller.sta;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.sta.StaPurposeDto;
import com.ysd.lis.entity.sta.StaReqPurpose;
import com.ysd.lis.request.StaPurposeParam;
import com.ysd.lis.service.sta.StaReqPurposeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-04-10
 */
@RestController
@RequestMapping("/api/sta/staReqPurpose")
public class StaReqPurposeController extends BaseController {

    @Autowired
    StaReqPurposeService bacReqPurposeService;
    @ApiOperation("查询")
    @GetMapping("/findPurposeList")
    public Result findPurposeList(StaPurposeParam param){
        return bacReqPurposeService.findPurposeList(param);
    }

    @ApiOperation("新增")
    @PostMapping("/addPurpose")
    public Result addPurpose(@RequestBody StaReqPurpose bacReqPurpose){
        return  bacReqPurposeService.addPurpose(bacReqPurpose);
    }

    @ApiOperation("修改")
    @PostMapping("/editPurpose")
    public Result editPurpose(@RequestBody StaReqPurpose bacReqPurpose) {
        return bacReqPurposeService.editPurpose(bacReqPurpose);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deletePurpose")
    public Result deletePurpose(@RequestBody StaReqPurpose bacReqPurpose) {
        return bacReqPurposeService.deletePurpose(bacReqPurpose);
    }
    @ApiOperation("批量删除")
    @PostMapping("/batchDeletePurposeList")
    public Result batchDeletePurposeList(@RequestBody StaPurposeDto dto){
        return  bacReqPurposeService.batchDeletePurposeList(dto);
    }
}
